import java.util.Arrays;
import java.util.Scanner;

public class demo01 {
    //最大数字
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        int[] arr=new int[str.length()];
        for (int i = 0; i < str.length(); i++) {
            arr[i]=str.charAt(i)-'0';
        }
        int n1=sc.nextInt();
        int n2=sc.nextInt();
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]<n2){
                while (arr[i]!=-1) {
                    arr[i]--;
                    n2--;
                }
                arr[i] = 9;
            }else {
                while (arr[i]<9&&n1>0){
                    arr[i]++;
                    n1--;
                }
            }
        }
        while (n2!=0){
            arr[arr.length-1]--;
            n2--;
        }
        String s= "";
        for (int i = 0; i < arr.length; i++) {
            s+=arr[i];
        }
        System.out.println(s);
    }
}
